<template>
  <div>
    <img alt="Vue logo" src="./assets/logo.png">
    <!-- <van-tag type="primary">标签</van-tag>
    <van-progress :percentage="50" />
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
      <van-swipe-item>3</van-swipe-item>
      <van-swipe-item>4</van-swipe-item>
    </van-swipe> -->
    <van-image-preview v-model:show="show" :images="images" @change="onChange">
      <template v-slot:index>第{{ index }}页</template>
    </van-image-preview>
  </div>
</template>

<script>
import { ref } from 'vue'
import 'vant/es/image-preview/style';

export default {
  name: 'App',

  setup() {
    const show = ref(false)
    const images = ['https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg']
    const index = ref(0);

    const onChange = (newIndex) => {
      index.value = newIndex;
    };


    return {
      show,
      images,
      index,
      onChange
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>